<template>
  <div>
    <p>这是parent</p>
    <ul>
      <li v-for="(item,index) in arr" :key="index" @click="handleA(item)">这是子组件接受的：{{item.a}}</li>
    </ul>
    <son :item='current'></son>
    <button @click="handleB">按钮</button>
    
  </div>
</template>
<script>
import son from "./son.vue";
export default {
  // inheritAttrs: false,
  components: {
    son,
  },
  props: {
    arr: {
      type: Array,
      default: ()=>[],
    },
  },
  data(){
    return {
      current:{}
    }
  },
  methods:{
    handleA(item){
      this.current = item
    },
    handleB(){
      this.arr.push({a:3})
    }
  }
};
</script>